using System;
using System.Data;
using System.Configuration;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Web.UI.HtmlControls;
using System.Collections;

/// <summary>
/// Summary description for Book
/// </summary>
namespace BookSpace
{
    public class Book
    {
        private static Hashtable book_hash = new Hashtable();

        String _title;
        public String Title
        {
            get { return _title; }
            set { _title = value; }
        }

        String _author;
        public String Author
        {
            get { return _author; }
            set { _author = value; }
        }

        String _isbn;
        public String Isbn
        {
            get { return _isbn; }
            set { _isbn = value; }
        }

        int _pages;
        public int Pages
        {
            get { return _pages; }
            set { _pages = value; }
        }

        String _language;
        public String Language
        {
            get { return _language; }
            set { _language = value; }
        }

        String _publisher;
        public String Publisher
        {
            get { return _publisher; }
            set { _publisher = value; }
        }

        String _description;
        public String Description
        {
            get { return _description; }
            set { _description = value; }
        }

        String _category;
        public String Category
        {
            get { return _category; }
            set { _category = value; }
        }

        String _id;
        public String ID
        {
            get { return _id; }
            set { _id = value; }
        }

        String _url;
        public String Url
        {
            get { return _url; }
            set { _url = value; }
        }

        public Book()
        {

            //
            // TODO: Add constructor logic here
            //

        }

        /// <summary>
        /// This creates an instance of Book
        /// </summary>
        /// <param name="title"></param>
        /// <param name="author"></param>
        /// <param name="isbn"></param>
        /// <param name="pages"></param>
        /// <param name="language"></param>
        /// <param name="publisher"></param>
        /// <param name="description"></param>
        /// <param name="category"></param>
        /// <param name="url"></param>
        /// <param name="id"></param>
        public Book(String title, String author, String isbn, int pages, String language, String publisher, String description, String category, String url, String id)
        {
            Title = title;
            Author = author;
            Isbn = isbn;
            Pages = pages;
            Language = language;
            Publisher = publisher;
            Description = description;
            Category = category;
            ID = id;
            Url = url;
            book_hash.Add(ID, this);
        }

        public static Book GetBook(String inf_id)
        {
            return (Book)Book.book_hash[inf_id];
        }
    }
}